UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ly6xL3uzzrGQukk8o0jS15T6Lqmyytkid6jAA5iGkaw='
WHERE
key_id = '6b6d0f213e88c7b3ad4484aebe6081a9b52a84b42362735d094a3113d1441250'
AND (
token = 'ly6xL3uzzrGQukk8o0jS15T6Lqmyytkid6jAA5iGkaw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)