UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kNkae9yTa+9hxiK9OHarw+OPpFwph9hbDnf7A9rD7ao=' 
WHERE 
  key_id = '019ed78d939e54ba32dbd475a9e3ce0729f6bd17ef2e2fd47265b393da8a852a' 
  AND (
    token = 'kNkae9yTa+9hxiK9OHarw+OPpFwph9hbDnf7A9rD7ao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028