UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1+iDOPVUWQl8skLSKvYpqI50taa2iIw5S9ZtF44uGvw='
WHERE
key_id = '966155630e8b0e7f5fc86d85d41f2c517af74a5873564ce4ead1880e0ec81abc'
AND (
token = '1+iDOPVUWQl8skLSKvYpqI50taa2iIw5S9ZtF44uGvw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)