UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3+y6NUI9JxLMMOmQwBq6vQgBaw/BsdBgqaOROHov9a4=' 
WHERE 
  key_id = '11d8a49dd8c995fab83121b9c1e52379c7cf3d79e7b744eb4ab8974bb8bf1e59' 
  AND (
    token = '3+y6NUI9JxLMMOmQwBq6vQgBaw/BsdBgqaOROHov9a4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033