UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nk4NXU8uFQQUIEo6NwMWNrm/sJV98w69DT4ikpRXSn0=' 
WHERE 
  key_id = '626e200180b0f03ec3aff685764ce2647345d014eb8044a193883954b1dfacb2' 
  AND (
    token = 'Nk4NXU8uFQQUIEo6NwMWNrm/sJV98w69DT4ikpRXSn0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048