UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KUx6ru8IkChXectGSJ2QJmosvKIqsx4B+Xsua8XTKvM='
WHERE
key_id = '28e8d47088825b482865588ba51ad3e10c3bbd5a8be465ca57e576453efaf700'
AND (
token = 'KUx6ru8IkChXectGSJ2QJmosvKIqsx4B+Xsua8XTKvM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)