UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pi5pLUVhPhbs5YzWa4efnvceosodmpHa4R6gYR/nv2g=' 
WHERE 
  key_id = '46c23f21252857d90eb7189dbd12e277e8366653cc80cc594c92b139c1581c41' 
  AND (
    token = 'Pi5pLUVhPhbs5YzWa4efnvceosodmpHa4R6gYR/nv2g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043