UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yLlOziMEBL5wuRUn97K6jGJrmzbkLvtbfiZP5ES83xI='
WHERE
key_id = '853d173908b29fb6664eb89e39094d9c778bd6e689cd83f907b52aa3359480b8'
AND (
token = 'yLlOziMEBL5wuRUn97K6jGJrmzbkLvtbfiZP5ES83xI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)