UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2FdxhVMC1ZWNEYynLSwssXaEQC93pncdlhfnWxaya4E=' 
WHERE 
  key_id = '2043f18ec1d629e685616bcaee44b7d58c6fdaf0c3bb463f2cd7c7e78f9fd364' 
  AND (
    token = '2FdxhVMC1ZWNEYynLSwssXaEQC93pncdlhfnWxaya4E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021