UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EBMhN3kFh/ANdUBCvjhHKYcHRs2TzlBFLpSrUlLK7TM='
WHERE
key_id = '0ec739fc963b87f43752ffe469757bdd41a9591a14b58d775dbac435758dea8a'
AND (
token = 'EBMhN3kFh/ANdUBCvjhHKYcHRs2TzlBFLpSrUlLK7TM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)