UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YULy++Yx4/aUSc6h6u244VYHFTMv/i8EOv6RqOWdyug='
WHERE
key_id = 'a7e579cfd990c9b25516af35506669e9d78d1802462034bbefaf4b7d923e0318'
AND (
token = 'YULy++Yx4/aUSc6h6u244VYHFTMv/i8EOv6RqOWdyug='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)