UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'toxLZsybrhEJvkAGzeuaqnOmWVL4lkme93cn/9liq5g='
WHERE
key_id = '4288f679a25d8b42c5269dc6fc50c1661610c4d315e2ce37828b761765ba5a7d'
AND (
token = 'toxLZsybrhEJvkAGzeuaqnOmWVL4lkme93cn/9liq5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)