UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8qyH6zB3as8h/zatxLiX+i0e7D8OLrpIOZsTuBVAb3w=' 
WHERE 
  key_id = 'b7c1c8d87a3f09fc62009a83f434cd93e180d557478bf55aeb16c914de6869b3' 
  AND (
    token = '8qyH6zB3as8h/zatxLiX+i0e7D8OLrpIOZsTuBVAb3w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042