UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o/fRj4My8oMkoMoGhXIH9K98TiJRzdnRFVA52lJk9Y4=' 
WHERE 
  key_id = '969372e8e63e28c25a1195e66ed502306c105c2a225093d8c65ebdfe2acf6017' 
  AND (
    token = 'o/fRj4My8oMkoMoGhXIH9K98TiJRzdnRFVA52lJk9Y4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034