UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tTk2iKdGDDwLOGEtVT5aglYmpLdIw1wzdGV5G7uc/C8=' 
WHERE 
  key_id = '993000e7c2d4eb18ac8de1f6dd2eb352fc51fcf88d10df8631d856b965f991af' 
  AND (
    token = 'tTk2iKdGDDwLOGEtVT5aglYmpLdIw1wzdGV5G7uc/C8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036