UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W6vTUXqlnV/9IFmqqtE/cj7qN9gE/rFCNje/NAhXavU=' 
WHERE 
  key_id = '08b70c4717f774efac7006580b3a8f9feafb2b73c10dcd0d4c756d58c78f32c1' 
  AND (
    token = 'W6vTUXqlnV/9IFmqqtE/cj7qN9gE/rFCNje/NAhXavU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034