UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GqcIyaTZmwaVckJWdyk9q90RjrocTVgWUoAC5rNvSik=' 
WHERE 
  key_id = 'd3128dd2b7b3131936c9e1a2b45f08f7e2121149072f03c7e06a46fd253c46c5' 
  AND (
    token = 'GqcIyaTZmwaVckJWdyk9q90RjrocTVgWUoAC5rNvSik=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040