UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VFV/J1690kzPWnFPyClMdAn+CxRBgAk0ixBXd9mGI38=' 
WHERE 
  key_id = 'e860a3b02cdda7b8af46cfb3e76a223108f7728f041221f5d5bff7b9dbca509d' 
  AND (
    token = 'VFV/J1690kzPWnFPyClMdAn+CxRBgAk0ixBXd9mGI38=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039