UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RQYCV7Baq/LpLD07jSrZKC3L3xYdwVSCeBrlyEf+Zl8=' 
WHERE 
  key_id = '220cb5b26b436434c46a78f9a3330b67f81cae6ba2a014bdc08e71cf91a9900b' 
  AND (
    token = 'RQYCV7Baq/LpLD07jSrZKC3L3xYdwVSCeBrlyEf+Zl8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044