UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bRdaj2tJKDF/0k1dFyPuDa8NiNItD+mir9cLzBxRdnU='
WHERE
key_id = '496e67b990f17efbecd93322e16f3d49a2f3e2ae9d25a72d1a95801ab2a07d9b'
AND (
token = 'bRdaj2tJKDF/0k1dFyPuDa8NiNItD+mir9cLzBxRdnU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)