UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm7VP0R7Y+0yLLx4QCZJna6mXUu9ND00NZN+3QLo+4n8='
WHERE
key_id = '2befdf667e5703a90689cf82eaa1589cf338985b5ac2f6b99f81aa94d2914f98'
AND (
token = 'm7VP0R7Y+0yLLx4QCZJna6mXUu9ND00NZN+3QLo+4n8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)