UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eg0ZcQUiBenM+OE0hbwc0uEvHHYoAGENZJldSM+1F+o=' 
WHERE 
  key_id = 'a75175dc0bfcf4deaf57b551722b99f92c9aea6cf238ad9258b67e715e0284b6' 
  AND (
    token = 'eg0ZcQUiBenM+OE0hbwc0uEvHHYoAGENZJldSM+1F+o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00100