UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7LKIfdyBtp+12Q1ix1vtq9mIk6ELlHxjgmKmgoF0MzM=' 
WHERE 
  key_id = 'ee0c14d892192c0d5cf142bc6c8b807cf2bb7510ad828d5c33deef4c7a863342' 
  AND (
    token = '7LKIfdyBtp+12Q1ix1vtq9mIk6ELlHxjgmKmgoF0MzM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029