UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'weXE5a4YSooTMYZRNtXCFyW4W8ITfecu/1tH2JWq5Ac=' 
WHERE 
  key_id = '01ee40bbb4f068fd36256b8d13f99247c1f21f07844cf298bf3eea469d578802' 
  AND (
    token = 'weXE5a4YSooTMYZRNtXCFyW4W8ITfecu/1tH2JWq5Ac=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049