UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rW9A/1Vo5kIjt0JXkyBzRY9QSLmp7n2BapbzA4nT1io=' 
WHERE 
  key_id = '05fa0c87a03a7ddcac9625df670bfd04ee5bffc5b38c70e7b33b9c30f7e2e08f' 
  AND (
    token = 'rW9A/1Vo5kIjt0JXkyBzRY9QSLmp7n2BapbzA4nT1io=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00135