UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T4UxbDPjlHZbjmlwND1bfyqdFOlzlU/mXJF452//z1o='
WHERE
key_id = '7773078580907f29e1a183534f62a19fe7fbe0d6aceaceb9cb1d108a104f514f'
AND (
token = 'T4UxbDPjlHZbjmlwND1bfyqdFOlzlU/mXJF452//z1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)