UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1lygLAoi/BQKLN+ukXc6M9yeWD7t3poIgaMb4f4kjYM='
WHERE
key_id = '1570e2384160662ad02f4cbcdb9ff64c5562024a520376a432a48d27297e332e'
AND (
token = '1lygLAoi/BQKLN+ukXc6M9yeWD7t3poIgaMb4f4kjYM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)