UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cikpLb1Ihx33Rhkio2m2mN/apsVTRCu6k3dh9MyRa70=' 
WHERE 
  key_id = 'd588fcd613c40a2f564d4060e463472ba38d8b284c54301400d69cb733b641d3' 
  AND (
    token = 'cikpLb1Ihx33Rhkio2m2mN/apsVTRCu6k3dh9MyRa70=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047