UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8n+hg5rz/8x85MvjT+TTdusTeWRSi3Ou06d1nvgREmo='
WHERE
key_id = '8808179e920843cb79d0319b127a5c8f985e557f1d9b56f21edaa9e54150092f'
AND (
token = '8n+hg5rz/8x85MvjT+TTdusTeWRSi3Ou06d1nvgREmo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)