UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4YBdsOhCQkdU5Y75zg/9c/9/54YjLVxBpKIecZJa2Is='
WHERE
key_id = '8adfc250919b2a19bc28a04a27fcf10de87435c793428cbcafbbc3dc7fc0a556'
AND (
token = '4YBdsOhCQkdU5Y75zg/9c/9/54YjLVxBpKIecZJa2Is='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)