UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7lEUsa28X2h104+2tn+/N8axkeOJIdGi6MshYQSAAeo=' 
WHERE 
  key_id = '627b35c8dec30e10268a7ebc3744831f9a2cf209bcbeff0c1deb03127dc96766' 
  AND (
    token = '7lEUsa28X2h104+2tn+/N8axkeOJIdGi6MshYQSAAeo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026