UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O8QzAqjCn9fAtPdJvCaQamjieBrdiJ4xwYihkTDxO6U='
WHERE
key_id = '36597321a1be5a4d9b0ec0bf845825d62534a7e932cfb3e7c6e46a2fda8c2aee'
AND (
token = 'O8QzAqjCn9fAtPdJvCaQamjieBrdiJ4xwYihkTDxO6U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)