UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6BkLZr344lmQzem+m6jnusr0rEM40KyteSUrtdyAJTw='
WHERE
key_id = '8c6af6ae29f6f6475e15114bbeb55bdc95442a2cef7c29a10f8a350e1f503b15'
AND (
token = '6BkLZr344lmQzem+m6jnusr0rEM40KyteSUrtdyAJTw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)