UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't53Nds+CAFwgQ6bSfsP7LdW0igFdNMas/38lSa69r2A=' 
WHERE 
  key_id = 'ac60271d0bb7dc16ddef522bee2fdf77a7f5d02f540158ed81d48cfefc3a68b3' 
  AND (
    token = 't53Nds+CAFwgQ6bSfsP7LdW0igFdNMas/38lSa69r2A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015