UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fOVWwyR6ATPCqsNaLpcDIjSAwMT59QOGP9u7d2kJVTg='
WHERE
key_id = 'c0d99318e997113897836043f3e1f6f8e6fdf00d38bb238cd8c98d0d91cc4115'
AND (
token = 'fOVWwyR6ATPCqsNaLpcDIjSAwMT59QOGP9u7d2kJVTg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)